package com.yvon.maple.service.msg.core.service;

import com.yvon.boot.mybatis.IBaseService;
import com.yvon.maple.service.msg.core.model.entity.ImContent;

import java.util.List;
import java.util.Set;

/**
 * @author : Yvon
 * @since : 2021-08-26
 */
public interface ImContentService extends IBaseService<ImContent> {

    /**
     * 发送消息.
     *
     * @param message   the message
     * @param consumers the consumers
     * @return the boolean
     * @author : Yvon / 2020-03-27
     */
    boolean send(ImContent message, Set<String> consumers);

    /**
     * 发送消息.
     *
     * @param message  the message
     * @param consumer the consumer
     * @return the boolean
     * @author : Yvon / 2020-03-27
     */
    boolean send(ImContent message, String consumer);

    /**
     * 获取用户未读消息数量
     *
     * @param username 用户名
     * @return long
     * @author : Yvon / 2021-09-02
     */
    long getUnReadCount(String username);

    /**
     * 查询用户未读消息
     *
     * @param username 用户名
     * @return {@link List<  ImContent  > }
     * @author : Yvon / 2021-09-02
     */
    List<ImContent> selectUnRead(String username);
}
